<?php

namespace App\Models\user;

use App\Models\base\traits\HasOwner;
use App\Models\base\traits\HasSuperior;
use Illuminate\Database\Eloquent\Model;


/**
 * App\Models\user\UserSuperior
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property int $superior_id 上级ID
 * @property int $level 上级层级(非会员等级)
 * @property int $is_top 上级是否为顶级会员(运营中心)  顶级会员享受团队奖
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User $superior
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereIsTop($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereSuperiorId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior owner($userId)
 * @property float $rebate user_id为superior_id带来的奖金总额
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereRebate($value)
 * @property int $user_level 上级用户等级
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\user\UserSuperior whereUserLevel($value)
 */
class UserSuperior extends Model
{

    use HasSuperior;
    use HasOwner;
    protected $fillable = [
        'user_id',
        'superior_id',
        'level',
        'is_top',
        'user_level'
    ];
}
